<?php
/**
 * Created by PhpStorm.
 * User: 68008000
 * Date: 2017/11/21
 * Time: 1:01
 */

namespace app\admin\controller;


use think\Controller;

class Webset extends common
{
    protected $db;

    public function __construct()
    {
        parent::__construct();
        $this->db = new \app\common\model\webset();
    }
    //首页
    public function index()
    {
        $data = $this->db->index();
        $this->assign('data',$data);
        //视图
        return view();
    }
    //异步修改
    public function edit(){
        $data= input('post.');
        $res = $this->db->edit($data);
        if($res['valid']){
            $this->success($res['msg'],'index');
        }else{
            $this->error($res['msg']);
        }
    }
}